#include <bits/stdc++.h>
using namespace std;
struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode() : val(0), left(nullptr), right(nullptr) {}
    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
    TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 };

class Test2Pre{
public:
	void traversal(TreeNode* cur,vector<int>& result){
		if(cur == NULL){
			return;
		}
		result.push_back(cur->val);
		traversal(cur->left,result);
		traversal(cur->right,result);
	}
	vector<int> preorderTraversal(TreeNode* root) {
		vector<int> result;
		traversal(root,result);
		return result;
	}
};


class TestPre {
public:
	void traversal(TreeNode* cur,vector<int>& result){
		if(cur == NULL){
			return;
		}
		result.push_back(cur->val);
		traversal(cur->left,result);
		traversal(cur->right,result);
	}
	
	vector<int> preorderTraversal(TreeNode* root) {
		vector<int> result;
		traversal(root,result);
		return result;
	}
};

class TestPoster {
public:
	void traversal(TreeNode* cur,vector<int>& result){
		if(cur == NULL){
			return;
		}
		traversal(cur->left,result);
		traversal(cur->right,result);
		result.push_back(cur->val);
	}
	
	vector<int> postorderTraversal(TreeNode* root) {
		vector<int> result;
		traversal(root,result);
		return result;
	}
};

class TestInorder {
public:
	void traversal(TreeNode* cur,vector<int>& result){
		if(cur == NULL){
			return;
		}
		traversal(cur->left,result);
		result.push_back(cur->val);
		traversal(cur->right,result);
	}
	
	vector<int> inorderTraversal(TreeNode* root) {
		vector<int> result;
		traversal(root,result);
		return result;
	}
};
int main(){
	
	
	return 0;
}
